package me.zhengjie.util;

import java.util.HashMap;
import java.util.Map;

public final class MapUtil {
    public static Map of (Object... params){
        Map map = new HashMap();
        int offset = 1;
        Object key = null;
        Object value = null;
        for (Object param : params) {
            if (offset%2 != 0){
                key = param;
            }else {
                value = param;
            }

            if (key != null && value != null){
                map.put(key, value);
                key = null;
                value = null;
            }
            offset++;
        }
        return map;
    }
}
